from django.conf.urls import url

from booktest import views
urlpatterns = [
    # 配置首页url
    url(r'^$', views.index),
    url(r'^index$', views.index,name='index'),
    # 配置详细页url，\d+表示多个数字，小括号用于取值，建议复习下正则表达式
    url(r'^(\d+)/$', views.detail),
    url(r'^createview/$', views.createview), #显示新增图书页面
    url(r'^saveBookInfo$', views.saveBookInfo), #保存图书

    url(r'^delete/(\d+)$', views.delete),

    url(r'^updateview/(\d+)$', views.updateview),
    url(r'^updateBookInfo$', views.updateBookInfo),

    url(r'^area/$', views.area), #省，市，区

    url(r'^showarg(\d+)$', views.show_arg), # 捕获url参数:位置参数
    url(r'^show(?P<num>\d+)$', views.show_arg),  # 捕获url参数:关键字参数

    url(r'^request_attr$', views.request_attr),
    url(r'^method_show/$', views.method_show),

    url(r'^show_fm/$', views.show_fm),
    url(r'^show_reqarg/$', views.show_reqarg),

    url(r'^json1/$', views.json1),
    url(r'^json2/$', views.json2),
    url(r'^red1/$', views.red1),

    
    url(r'^set_cookie$', views.set_cookie),  # 设置cookie
    url(r'^get_cookie$', views.get_cookie),  # 获取cookie

    url(r'^set_session$', views.set_session),  # 设置session
    url(r'^get_session$', views.get_session),  # 获取session
    url(r'^clear_session$', views.clear_session),  # 清除session
    

    url(r'^login$', views.login),  # 显示登录页面
    url(r'^login_check$', views.login_check),  # 用户登录校验
    url(r'^change_pwd$', views.change_pwd),  # 修改密码页面显示
    url(r'^change_pwd_action$', views.change_pwd_action),  # 修改密码处理
    url(r'^login_out$', views.login_out),  # 用户登出

    url(r'^test_ajax$', views.ajax_test),  # 显示ajax页面
    url(r'^ajax_handle$', views.ajax_handle),  # ajax处理

    url(r'^login_ajax$', views.login_ajax),  # 显示ajax登录页面
    url(r'^login_ajax_check$', views.login_ajax_check),  # ajax登录校验


 

    url(r'^temp_var$', views.temp_var),  # 模板变量
    url(r'^temp_tags$', views.temp_tags),  # 模板标签
    url(r'^temp_filter$', views.temp_filter),  # 模板过滤器

    url(r'^temp_inherit$', views.temp_inherit),  # 模板继承

    url(r'^html_escape$', views.html_escape),  # html转义
    #url(r'^verify_code$', views.verify_code), # 产生验证码图片

    url(r'^url_reverse$', views.url_reverse), # url反向解析页面
    url(r'^show_args/(\d+)/(\d+)$', views.show_args, name='show_args'), # 捕获位置参数
    url(r'^show_kwargs/(?P<c>\d+)/(?P<d>\d+)$', views.show_kwargs, name='show_kwargs'),  # 捕获关键字参数
    url(r'^test_redirect$', views.test_redirect),

    url(r'^pic_upload/$', views.pic_upload),#上传
    url(r'^pic_handle/$', views.pic_handle),#

    url(r'^page(?P<pIndex>[0-9]*)/$', views.page_test),#分页

    url(r'^area1/$', views.area1),#下拉联动
    url(r'^area2/$', views.area2),
    url(r'^area3_(\d+)/$', views.area3),
]